<!DOCTYPE html>
<html lang="en">
<head>
    <title>滚滚向前投票助手</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <!--<!--强制让文档的宽度与设备的宽度保持1:1，并且文档最大的宽度比例是1.0，且不允许用户点击屏幕放大浏览-->
    <link rel="shortcut icon" type="image/x-icon" href="/Images/favicon.ico" media="screen" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/dist/plugins/scroll/swiper-3.3.1.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <!--<script src="https://file.ggxqce.com/web/vue.min.js"></script>-->
    <script type="text/javascript" src="/dist/plugins/vue/vue.js"></script>
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link href="votePublic.css" rel="stylesheet"/>
    <style>
        [v-cloak] {
            display: none;
        }
        /* for Chrome */
        .inner-container::-webkit-scrollbar {
            display: none;
        }
        input:focus {
            　　font-size: 16px !important;
        }
        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        body {
            background: #fff;
        }

        .btn-blue {
            border: none;
            background: #2a8ced;
            color: #fff;
            height: 30px;
            width: 14%;
            border-radius: 3px;
        }

        .visitingBox {
            margin: 0 5px;
            margin-top: 5px;
            padding-bottom: 50px;
        }

        .item {
            height: 44px;
            line-height: 44px;
            padding: 0 5px;
            font-size: 12px;
            position: relative;
            border-bottom: 1px solid rgb(238,238,238);
            display: table;
            width: 100%;
            padding-left: 55px;
            padding-right: 95px;
            overflow: hidden;

        }
        .item .name{
            position: absolute;
            left: 0;
            top: 11px;
            line-height: 22px;
            text-align: left;
            padding-left: 5px;
            text-align: justify;
            width: 41px;
        }
        .item .name:after { content: " "; display: inline-block; width: 100%;}
        .item .maoHao{
            position: absolute;
            left: 42px;
            top: 10px;
            line-height: 22px;
            text-align: left;
        }


        .item .center{
            float: none;
            margin-right: 50px;
            display: table-cell;
            vertical-align: middle;
        }
        .item .center span{
            vertical-align: middle;
            display: table-cell;
            float: none;
            line-height: 22px;
            max-height: 45px;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            visibility: inherit;
            margin-top: 2px;
        }
        .daItem{
            background: #fff;
            margin: 10px 0;
            padding: 0 15px;
            border:2px solid transparent;
            overflow: hidden;
        }
        .daItemActive{
            background: #fff;
            margin: 0;
            padding: 0 15px;
            border:2px solid #1296db;
            box-sizing: content-box;
            overflow: hidden;
        }
        .num,.bfb{
            float:right;
            margin-right: 10px;
            font-size: 12px;
        }
        .people{
            height: 36px;
            line-height: 30px;
            font-size: 12px;
            margin: 0 5px;
        }

        .people input{
            text-align: left;
            width: 50%;
            float:left;
            padding-left: 10px;
            font-size: 16px;
            border: 2px solid rgb(238,238,238);

        }
        .peopleList{
            line-height: 45px;
            font-size: 12px;
            padding-left: 15px;
            overflow: hidden;
            position: relative;
        }
        .peopleItem{
             overflow: hidden;
         }
        .people .name ,.peopleList .name,.peopleList .desc{
            float:left;
            height: 45px;
            line-height: 45px;
        }
        .peopleItem .name ,.peopleItem .desc{
            position: relative;
            height: 30px;
            line-height: 30px;
        }

        .center{
            float:left;
        }
        .duiIcon{
            width: 20px;
            height: 20px;
            background: url("/dist/img/duiIcon.png");
            background-size: cover;
            float:left;
            margin-top: 10px;
            margin-left: 10px;
        }
        .jt{
            background-image: url(/dist/img/xianxiaIcon.png);
            background-size: cover;
            width: 20px;
            height: 20px;
            position: absolute;
            right: 10px;
            top: 10px;
            /* margin-top: 12px; */
            /* margin-right: 10px; */
            border-radius: 50%;
            margin-left: 10px;
        }
        .item .title {
            float: left;
        }

        .item .time {
            /* float: right; */
            color: #aaa;
            /* line-height: 22px; */
            position: absolute;
            width: 90px;
            right: 5px;
            top: 10px;
            line-height: 22px;
            text-align: right;
        }
        .noGood{

            color:red;
        }
        .noGood .time{
            color:red;
        }

        .btn-blue.focus, .btn-blue:focus, .btn-blue:hover {
            color: #fff;
            text-decoration: none;
        }

        .lineTwo span {
            max-height: 55px;
            line-height: 16px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;
            padding: 5px;

        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .imgBox {
            margin-left: 20px;
        }

        .imgBox .title {
            padding-left: 5px;
            height: 45px;
            line-height: 45px;
            position: relative;
            font-size: 14px;
        }

        .imgBox .title i {
            position: absolute;
            left: -10px;
            top: 2px;
            color: red;
            font-size: 16px;
        }

        .imgBox img {
            width: 80px;
            height: 80px;
            margin-bottom: 20px;
        }

        .imgBox .desc {
            color: #aaa;
        }

        .btnBox {
            width: 120px;
            height: 120px;
            margin: 0 auto;
            margin-top: 60px;
            position: relative;
        }

        .btnBj {
            background: #cde2f7;
            border-radius: 50%;
            width: 100%;
            height: 100%;
            position: relative;
            animation: mymove 3s infinite;
            -webkit-animation: mymove 3s infinite; /*Safari and Chrome*/
            animation-direction: alternate; /*轮流反向播放动画。*/
            animation-timing-function: linear; /*动画的速度曲线*/
            /* Safari 和 Chrome */
            -webkit-animation: mymove 3s infinite;
            -webkit-animation-direction: alternate; /*轮流反向播放动画。*/
        }

        .btn.active {
            background: #2a8cec;
        }

        .btnFix {
            position: absolute;
            width: 96px;
            height: 96px;
            left: 50%;
            top: 50%;
            margin-left: -48px;
            margin-top: -48px;
            border-radius: 50%;
            background: #dfdfdf;
            color: #fff;
        }

        .btn .time {
            font-size: 20px;
            margin-top: 14px;
        }

        .btn .start {
            font-size: 16px;
        }

        @keyframes mymove {
            0% {
                transform: scale(1); /*开始为原始大小*/
            }

            50% {
                transform: scale(0.8);
            }

        }

        @-webkit-keyframes mymove /*Safari and Chrome*/
        {
            0% {
                transform: scale(1); /*开始为原始大小*/
            }

            50% {
                transform: scale(0.8);
            }
        }

        .touBtn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #2a8cec;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            margin: 0 auto;
            z-index: 11111;
        }
        .touBtn div{
            float:left;
            width: 50%;
            box-sizing: border-box;
        }
        .touBtn .line{
            height: 24px;
            width: 1px;
            background: #fff;
            position: absolute;
            left: 50%;
            top: 13px;
        }
        .okBtn{
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #2a8cec;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            position: absolute;
            bottom:0;
            left:0;
            cursor: pointer;
        }

        .item input {
            border: none;
            width: 100%;
            height: 43px;
            line-height: 43px;
        }

        .voteTitle {
            font-size: 20px;
            font-weight: bold;
        }

        .addIcon {
            background: url("/dist/img/jiaIcon.png");
            background-size: cover;
            width: 20px;
            height: 20px;
            float: left;
            margin-top: 12px;
            margin-right: 10px;
        }

        .removeIcon {
            background: url("/dist/img/jianIcon.png");
            background-size: cover;
            width: 20px;
            height: 20px;
            position: absolute;
            margin-right: 5px;
            margin-top: 12px;
        }

        .timeBox {
            height: 45px;
            line-height: 45px;
            font-size: 12px;
            position: relative;
            margin: 0;
            margin-top: 10px;
            padding: 0 15px;
            color: #aaa;
            border-top: 1px solid #ddd;
        }
        input::-webkit-input-placeholder {
            color: #aaa;
        }
        textarea::-webkit-input-placeholder {
            color: #aaa;
        }


        textarea{
            width: 100%;
            font-size: 16px;
            line-height: 24px;
            padding: 5px 10px;
            height: 180px;
            border: 2px solid rgb(238,238,238);
            resize:none
        }
        .slh{
            background-color: #fff;
            background-image: url("/dist/img/slhIcon.png");
            background-size: cover;
            width: 20px;
            height: 20px;
            float: left;
            margin-top: 12px;
            margin-right: 10px;
            border-radius: 50%;
            margin-left: 10px;
        }
        .tabBox{
            height: 45px;
            line-height: 45px;
            background: #2a8cec;
            width: 100%;
            position: fixed;
            top: 0;
            z-index: 99999999;
        }
        .tabScBox{
            height: 45px;
            margin: 0 auto;
            overflow-x: scroll;
            overflow-y: hidden;
        }
        .tabList{
            height: 45px;
            display: -webkit-box;
            background: #2a8cec;
            float: left;
            padding: 0 10px;
        }

        .tabItem.active .tab{
            color:#2a8cec;
            background-image: url(/dist/img/tabApp.png);
            background-size: 100% 100%;
            margin-top: 2px;
        }
        .tabItem{
            height: 40px;
            line-height: 40px;
            width: 100px;
            text-align: center;
            color:#fff;
            float:left;
            margin-top: 5px;
            position: relative;
            font-size: 14px;
        }
        .tab{
            margin: 0 10px;
            text-align: center;
            display: block;
            position: relative;
            margin-top: 2px;
        }
        .tabItem i{
            height: 15px;
            border-radius: 50%;
            color: red;
            line-height: 15px;
            text-align: center;
            position: absolute;
            font-style: normal;
            font-size: 12px;
            margin-left: -3px;
        }
        .infoBox{
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 80px;
            background: rgb(243,244,248);
            padding:10px 5px;
            display: none;
        }
        .infoBox .title{
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .infoBox .desc{
            font-size: 16px;
        }
        .list_shadow{
            position: absolute;
            top: 0;
            right: 0;
            padding-right: 0px;
            width: 14px;
            height: 100%;
            text-align: right;
            background-image: linear-gradient(to left,#eee 0,#2a8cec 100%);
        }
        iframe{
            display: none;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .fjBox,.nofjBox{
            height: 45px;
            text-align: center;
            line-height: 45px;
            position: fixed;
            top:45px;
            left:0;
            width: 100%;
            color:#2a8cec;
            font-size: 16px;
            padding: 0 70px;
            padding-left: 10px;
            z-index: 999999999;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            background: #fff;
            border-bottom: 1px solid rgb(238,238,238);

        }
        .removeBtn{
            position: absolute;
            right: 50px;
            top: 0;
            font-size: 14px;
            color: #2a8cec;
        }
        .updateUserBtn{
            position: absolute;
            right: 0;
            top: 0;
            padding-right: 10px;
            font-size: 14px;
            color: #2a8cec;
        }
        .lookWj{
            position: absolute;
            right: 0;
            top: 0;
            padding-right: 10px;
            font-size: 14px;
            width: 60px;
            text-align: right;
            color: #2a8cec;
        }

        .userBtnBox{
            margin: 0 auto;
            position: relative;
        }
        .cancelBtn{
            background: #FFF !important;
            background-size: 100% 100% !important;
            color: #333 !important;
            min-width: 80px;
            text-align: center !important;
            border: 1px solid #DDD;
            border-radius: 0px !important;
        }
        .fj-tanzhongStyle{margin-top: 3px;height: 40px;background-color: #fff;}
        .fj-tanzhongStyle .img {
            transform: scale(1, 1);
            margin: 4px 0 0 4px;
        }
        .fj-tanzhongStyle .name {
            line-height: 40px;
            text-align: left;
            height: 40px;
            font-size: 14px;
            top: 0;
            width: 100%;
            padding-right: 50px;
            color: #2a8cec;

        }
        .scfj{
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 45px;
            line-height: 45px;
            padding-left: 15px;
            margin: 0 auto;
            width: 100px;
            border-radius: 4px;
            color: #74adf2;
            text-align: left;
        }
        .moreI{
            margin-left: -8px;
        }
        #scroll .refreshtip {position: absolute;left: 0;width: 100%;margin: 10px 0;text-align: center;color: #999;}
        #scroll.swiper-container{overflow: visible;}
        #scroll .loadtip { display: block;width: 100%;line-height: 40px; height: 40px;text-align: center;color: #999;border-top: 1px solid #ddd;}
        #scroll.swiper-container, .w{padding-top: 45px;}
        #scroll .swiper-slide{height: auto;}

        #scroll .text-center{text-align: center;}
        #scroll .list-group{padding-left: 0;margin-bottom: 45px;}
        #scroll .list-group-item{    position: relative; display: block;padding: 10px 15px;margin-bottom: -1px;background-color: #fff;border: 1px solid #ddd;}
        #scroll .list-group-item:first-child {border-top-left-radius: 4px;border-top-right-radius: 4px;}
    </style>
</head>
<script src="votePublic.css">
    function ajsx() {
        $(".ssday").cloneNode(findParent.length())
    }
</script>
<body>
<section class="content" id="app" style="padding: 0px;" v-cloak>
    <div class="treeBox" v-show="userModel">
        <div class="tabContent">
            <div class="tabContentLeft"></div>
            <div class="tabContentMiddle">
             <span :class="selectTree==0? 'tabActive':'tabNo'" @click="selectTree=0;changeTree()">
                    按组织结构选择
                </span>
                <span id="cusBtn" :class="selectTree==1? 'tabActive':'tabNo'" @click="selectTree=1;">
                    按部门岗位选择
                </span>
            </div>
            <div class="tabContentRight"></div>
        </div>
        <div style="overflow: auto;background: #f7f8fa;margin: 15px 20px;margin-top: 60px;border: 1px solid #ddd;">
            <div class="selectBox" v-show="selectTree==1">
                <div class="typeTitle">请选择公司：</div>
                <div class="companyLIst listBox">
                    <div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.companyList" @click="selectItem(item,'1')">{{item.name}}</div>
                </div>
                <div class="typeTitle">请选择部门：</div>

                <div class="companyLIst listBox">
                    <div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.departList"  @click="selectItem(item,'2')">{{item.departName}}</div>
                    <div class="noData" v-if="selectBox.departList.length==0">请先选择公司</div>
                </div>
                <div class="typeTitle">请选择职位：</div>
                <div class="companyLIst listBox">
                    <div :class="item.select?'item active':'item'" v-for="(item,i) in selectBox.roleList"  @click="selectItem(item,'3')">{{item.roleName}}</div>
                    <div class="noData" v-if="selectBox.roleList.length==0">请先选择部门</div>
                </div>
            </div>
            <div v-show="selectTree==0">
                <div class="inputTreeBox">
                    <input type="text" class="selecetInput" placeholder="输入姓名" id="autoUser" v-on:input="get_search()">
                    <input type="button" class="search-button">
                </div>
                <ul class="ztree" id="ulRegion" style="height: 75vh;overflow-y: auto;" ></ul>
            </div>
        </div>
        <div class="userBtnBox">
            <div class="btn oaBtn" @click="saveUser">确认</div>
            <div class="btn  cancelBtn" @click="cancel">取消</div>
        </div>
    </div>


    <div class="div-td-content-more"><i></i></div>
    <div class="swiper-container tabBox" id="nav">
        <div class="swiper-wrapper">
            <template v-for="(item,i) in tabList">
                <div :class="selectIndex==i?'swiper-slide active tabItem':'swiper-slide tabItem' " v-intab="1" @click="getTab(i,item,true);">
                    <div class="tab">{{item.description}}<i :class="tabList.length>4?'moreI':''">{{item.count}}</i></div></div>
            </template>


        </div>
    </div>
    <template v-if="tabList[selectIndex]&&tabList[selectIndex].attrName">
            <div class="fjBox"  :style="'text-align: left;padding-right: 80px;top:'+(i+1)*45+'px'" v-for="(item,i) in tabList[selectIndex].attrUrlList">
                <div class="fj-tanzhongStyle" @click="lookFj(tabList[selectIndex].attrUrlList[i])">
                    <b :class="fjStyle(tabList[selectIndex].attrNameList[i])"></b>
                    <div class="name"  :title="tabList[selectIndex].attrNameList[i]">
                        {{tabList[selectIndex].attrNameList[i]}}
                    </div>
                </div>
                <!--<span  @click="lookFj(tabList[selectIndex].attrUrl)" style="background: url(/dist/img/fjT1.png) no-repeat 5px center;padding-left: 15px;">{{tabList[selectIndex].attrName}}</span>-->
                <!--<div class="updateUserBtn" @click="updateUser" v-if="mainInfo.createUserId==userId&&!isEnd" >修改投票人</div>-->
                <div class="removeBtn" @click="removeFj(i)" v-if="mainInfo.auditFlag==='-2'&&tabList[selectIndex].description==userInfo.name">删除</div>
                <div class="removeBtn" @click="downFj(tabList[selectIndex].attrNameList[i],tabList[selectIndex].attrUrlList[i])" >分享</div>
                <div   class="updateUserBtn" @click="lookFj(tabList[selectIndex].attrUrlList[i])"  >查看</div>

            </div>
    </template>
    <template v-else>
        <div v-if="mainInfo.auditFlag==='-1'&&tabList[selectIndex].attrUrl==''&&mainInfo.createUserId==userId"
             class="nofjBox" style="padding-right: 10px;" @click="uploadFj(1)">
            协助上传文件
        </div>
        <div class="nofjBox"  style="padding-right:10px;color:#aaa;" v-else>暂未上传参投文件
            <!--<div class="updateUserBtn" @click="updateUser" v-if="mainInfo.createUserId==userId&!isEnd">修改投票人</div>-->
        </div>
    </template>


    <div class="swiper-container" id="scroll">
        <div class="swiper-wrapper w scrollHeight" >
            <div class="swiper-slide d">
                <div class="init-loading list-group-item text-center" style="display: none;">下拉可以刷新</div>
                        <div class=" list-group">
                                <div class="item" v-for="(item,i) in list" v-if="tabList[selectIndex].flag!='3'||status==3||isEnd">
                                    <div class="name">{{item.createUserName}}</div>
                                    <div class="maoHao">：</div>
                                    <div  :class="item.status=='1'?'center':'center noGood'"><span>{{item.reason}}</span></div>
                                    <div class="time">{{formatDate(item.createTime)}}</div>
                                </div>
                            <template v-if="mainInfo.auditFlag=='-1'">
                                <div class="item " v-if="list.length==0" style="color:#ddd;border:none;text-align: center;margin-top: 50px;    padding-left: 0;padding-right: 0;">暂无投票信息，快来投他一票！</div>
                                <div class="item " v-else-if="tabList[selectIndex].flag=='3'&&status!=3&&!isEnd" style="color:#ddd;border:none;text-align: center;margin-top: 50px;    padding-left: 0;padding-right: 0;">您暂未投票，投票后显示列表！</div>
                            </template>
                        </div>
            </div>
        </div>
        <div class="swiper-scrollbar"></div>
    </div>

    <!--------------------------------------------------------------------按钮部分-------------------------------------------------------------------->
    <!--mainInfo==='-2' 投票未开始-->
    <template v-if="mainInfo.auditFlag==='-2'">
        <!--参投人员-->
        <div v-if="tabList[selectIndex].description==userInfo.name&&!tabList[selectIndex].attrUrl" class="touBtn" @click="uploadFj()">上传文件</div>
        <div v-else-if="tabList[selectIndex].description==userInfo.name" class="touBtn" @click="uploadFj()">继续上传参投文件</div>
        <!--其他人员-->
        <div v-else class="touBtn" style="background: #aaaaaa;">投票尚未开始</div>
    </template>

    <template v-if="mainInfo.auditFlag==='-1'">
        <div v-if="status=='3'" class="touBtn" style="background: #aaaaaa;">无投票权限</div>
        <!--<div v-if="status=='3'&&userInfo.roleName!='后台管理'&&userInfo.roleName!='集团销售管理'&&userInfo.roleName!='集团副总裁'&&userInfo.roleName!='总裁'" class="touBtn" style="background: #aaaaaa;">无投票权限</div>-->
        <div class="touBtn" v-else-if="status=='1'&&tabList[selectIndex].flag=='3'">
            <div class="touTa"  @click="tp(1)" >投</div>
            <div class="noTouTa"  @click="tp(2)" >不投</div>
            <i class="line"></i>
        </div>
        <div class="touBtn"  v-else-if="status=='2'&&tabList[selectIndex].flag=='3'">
            <div class="noTouTa" @click="tp(2)" style="width: 100%">请填写不投票理由</div>
        </div>
        <!--<div class="touBtn" v-else-if="(userInfo.roleName=='后台管理'||userInfo.roleName=='集团销售管理'||userInfo.roleName=='集团副总裁'||userInfo.roleName=='总裁')&&tabList[selectIndex].flag=='3'">-->
        <div class="touBtn" v-else-if="tabList[selectIndex].flag=='3'">
            <div class="touTa"  @click="tp(1)" >投</div>
            <div class="noTouTa"  @click="tp(2)" >不投</div>
            <i class="line"></i>
        </div>
    </template>
    <!--投票已截止-->
    <template v-if="mainInfo.auditFlag==='0'||mainInfo.auditFlag==='1'||mainInfo.auditFlag==='2'||isEnd">
        <div  class="touBtn" style="background: #aaaaaa;">投票已截止</div>
    </template>

    <div class="inputBoxBj" v-if="showModel" v-on:click.self="closeModel">
        <div class="inputBox">
            <img src="/dist/img/gb_icon@2x.png"  class="gbBtn" @click="closeModel">
            <div class="title item">{{isGood=='1'?'请输入投票理由':'请输入不投票理由'}}</div>
            <div class="desc">
                <textarea name="" id="" cols="30" rows="10" :placeholder="isGood=='1'?'请输入投票理由':'请输入不投票理由'" v-model="reason" @blur="initPage"></textarea>
            </div>
            <div class="okBtn" @click="save">确认</div>

        </div>
    </div>
</section>

<!--JQ-->
<script src="/dist/plugins/scroll/jquery-2.1.4.min.js"></script>
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="/dist/plugins/scroll/swiper.jquery.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<!--插件JS-->

<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script>

</script>
<script>
    $(function () {
        $("body").on("click", ".center", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        page: {
            urlParams: null,
            queryParams: {
                requestPage: 1,
                pageSize: 30
            },
            dataUrl: '',
            createQueryParams: function () {
            },
            getByPage: function (type) {
                $.ajax({
                    url: $.wyui.page.dataUrl,
                    data: JSON.stringify($.wyui.page.queryParams),
                    beforeSend: function () {

                    },
                    complete: function () {
                    },
                    success: function (r) {
                        $.wyui.page.queryParams.requestPage++;

                        if (r.data.sendData.pager && r.data.sendData.pager.pageCount == 0) {
                            r.data.sendData.pager.pageCount = 1;
                        }
                        if (type == "scroll") {
                            $.wyui.page.getByPage_scroll_callback(r.data.sendData.records);
                        } else {
                            if ($.wyui.page.getByPage_callback_new) {
                                $.wyui.page.getByPage_callback_new(r.data.sendData.records);
                            }
                        }

                    }
                });
            }
        },
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    $(function () {
        var zTreeRegion_setting = {
            view: {
                showIcon: function (treeId, treeNode) {
                    return treeNode.isParent;
                }
            },
            data: {
                simpleData: {
                    enable: true
                }
            },
            check: {
                chkboxType: { "Y": "ps", "N": "ps" },
                enable: true
            },
            callback: {
                onCheck: zTreeOnCheck,
                beforeClick:zTreeBeforeClick
            }
        };
        $.ajax({
            url: server.ip + "/email/getOrgInbox.json",
            data: JSON.stringify({
                userId: getUrlParamObj().userId
            }),
            success: function (r) {
                var nodes=r.data.sendData;
                for (var i = 0; i < nodes.length; i++) {
                    if (nodes[i].name == "收件箱") {
                        nodes[i].name ="组织机构";
                    }
                }
                app.treeObj = $.fn.zTree.init($("#ulRegion"), zTreeRegion_setting, nodes);

            }
        });

        function zTreeBeforeClick(treeId, treeNode, clickFlag) {
            app.treeObj.checkNode(treeNode, '', true);
            return false;
        }
        function zTreeOnCheck(treeId, treeNode) {
            console.log(treeNode);
            var receivers = new Array();
            var Nodes = app.treeObj.getCheckedNodes(true);
            for (var i = 0; i < Nodes.length; i++) {
                if(Nodes[i].type == "user") {
                    receivers.push(Nodes[i].name+"; ");
                }
            }
            console.log(receivers);

            $(".userBox").html(receivers)
        };
    });
</script>
<script type="text/javascript">
    function NewDate(str){
        if(!str){
            return 0;
        }
        arr=str.split(" ");
        d=arr[0].split("-");
        t=arr[1].split(":");
        var date = new Date();
        date.setUTCFullYear(d[0], d[1] - 1, d[2]);
        date.setUTCHours(t[0]-8, t[1], t[2], 0);
        return date;
    }
    var query = null;
    var app = new Vue({
        el: '#app',
        data: {
            selectTree:0,
            draftList:[],
            selectBox:{
                companyList:[],
                departList:[],
                roleList:[],
                selectCompany:[],
                companyNames: [],
                departNames: [],
                roleNames: [],
                companyIds: [],
                userIds:[]
            },
            voteUsers:[],
            swiper:"",
            mySwiper:"",
            reason:"",
            createUserName:"",
            userId: getUrlParamObj().userId,
            mainId:getUrlParamObj().mainId,
            name:getUrlParamObj().name,
            scfj:getUrlParamObj().scfj,
            parentId:"",
            themeId:"",
            themeName:"",
            date: "",
            selectIndex:0,
            tabList:[],
            tel:"",
            pwd:"",
            info: {
                        title: "",
                        desc: "",
                        deadline:'',
                        answer: [
                            {
                                "title": "", "value": [
                                {"desc": "A"}, {"desc": "B"}
                            ]
                            }
                        ]
                    },
            userInfo:{},
            showModel:false,
            isMole:true,
            list:[],
            tou:"",
            isGo:true,
            status:0,
            isGood:1,
            isEnd: false,
            enableMsg:'',
            userModel:false,
            treeObj:"",
            mainInfo:{}
        },
        methods: {
            downFj:function (name,url) {
                var that = this

                var param = {
                    title: name,
                    content: '',
                    imgUrl: 'http://oa.yingfeng365.com/dist/img/PPT.png',
                    linkUrl: url
                }
                JSBridge.call(SHARE, 'showShareMenu', param, function (res) {
                    that.showToast(res)
                })
            },
            showInnerFile:function () {
                var that=this;
                if(that.tabList[that.selectIndex].flag=='3'&&that.status!=3&&that.mainInfo.auditFlag=='-1'&&that.tabList[that.selectIndex].attrUrl){
                    var top=140;
//                    var num=app.tabList[app.selectIndex].attrUrlList.length;
//                    if(num>1){num=num-1;}
//                    top=top+num*45;
                    var param = {
                        isShow: true,
                        url: that.tabList[that.selectIndex].attrUrlList[that.tabList[that.selectIndex].attrUrlList.length-1],
                        marginTop:140,
                        marginBottom:160,
                    }
                    JSBridge.call(UI, 'showInnerFile', param, function (res) {

                    })
                }else{
                    var param = {
                        isShow: false
                    }
                    JSBridge.call(UI, 'showInnerFile', param, function (res) {

                    })
                }
            },
            get_search:function () {
                clearTimeout(query);
                query = setTimeout(function () {
                    searchTree()
                }, 1000);
            },
            removeFj:function (idx) {
                var that=this;
                     var param =  that.tabList[that.selectIndex].description
                    console.log(idx)
                debugger;
                    that.tabList[that.selectIndex].attrNameList.splice(idx,1);
                    that.tabList[that.selectIndex].attrUrlList.splice(idx,1);
                    console.log(idx)
                    $.wyui.postMethod('/vote/updateVoteTheme.json', {mainId: that.mainId,description:param,attrUrl:that.tabList[that.selectIndex].attrUrlList.join(";"),attrName:that.tabList[that.selectIndex].attrNameList.join(";")}, function (data) {
                        JSBridge.call(UI, 'showToast', {title: "删除成功"})
                        that.getTab(that.selectIndex);
                    })
            },
            uploadFj:function (type) {
                var that=this;
                JSBridge.call(FILE, 'uploadFile',{},function (res) {
                    var data = res.sendData;
                    var param = "";
                    if(type){
                        //创建人协助上传附件
                        param = that.tabList[that.selectIndex].description
                    }else{
                        param =  that.userInfo.name
                    }
                    if(data.url){
                        that.tabList[that.selectIndex].attrNameList.push(data.name)
                        that.tabList[that.selectIndex].attrUrlList.push(data.url)
                        $.wyui.postMethod('/vote/updateVoteTheme.json', {mainId: that.mainId,description:param,attrUrl:that.tabList[that.selectIndex].attrUrlList.join(";"),attrName:that.tabList[that.selectIndex].attrNameList.join(";")}, function (data) {
                            console.log(data)
                            if(data.id=='true'){
                                JSBridge.call(UI, 'showToast', {title: "上传成功！"})
                                that.getTab(that.selectIndex);
                            }
                        })
                    }
                })
            },
            uploadFile: function (index,index2) {
                var that = this
                JSBridge.call(FILE, 'uploadFile',{},function (res) {
                    var data = res.sendData;
                    that.info.voteThemeList[index].value[index2].attrUrl=data.url;
                    that.info.voteThemeList[index].value[index2].attrName=data.name;
                })
            },
            getCompanyList:function () {
                var that=this;
                $.wyui.postMethod('/company/getCompanyByUserId.json', {userId: '201711271733404C9DA1461F2421F828'}, function (data) {
                    for (var i = 0; i < data.length; i++) {
                        if (that.selectBox.companyNames.indexOf(data[i].name) != -1) {
                            data[i].select =true
                        } else {
                            data[i].select = false
                        }
                    }
                    that.selectBox.companyList = data


                })
            },
            changeTree:function () {
                var that=this;
                JSBridge.call(UI, 'showLoading', {})
                setTimeout(function () {
                    that.hideLoading()
                }, 2000)
                if(that.selectBox.userIds.length>0){
                    var userIdsStr=that.selectBox.userIds.join(',')
                    this.treeObj.getNodesByFilter(function (node) {
                        if(userIdsStr.indexOf(node.id)>-1) {
                            console.log(node.id)
                            that.treeObj.checkNode(node, true, true, false);
                        }else{
                            that.treeObj.checkNode(node, false, false, false);
                        }
                    });
                }

            },
            selectDepart: function () {
                var that = this;
                if(that.selectBox.companyIds.length>0){
                    var companyIds=that.selectBox.companyIds.join(',');
                    $.wyui.postMethod('/exam/getDepartListByCompanyIds.json', {companyIds: companyIds}, function (data) {
                        console.log(data)
                        for (var i = 0; i < data.result.length; i++) {
                            if (that.selectBox.departNames.indexOf(data.result[i].departName) != -1) {
                                data.result[i].select = true;
                            } else {
                                data.result[i].select = false
                            }
                        }

                        that.selectBox.departList = data.result
                        that.selectBox.roleNames=[];
                        for(var i=0;i<that.selectBox.roleList.length;i++){
                            that.selectBox.roleList[i].select=false;
                        }
                    })
                }

            },
            selectRoleName: function () {
                var that = this;
                if(that.selectBox.departNames.length>0) {
                    var companyIds=that.selectBox.companyIds.join(',');
                    var departNames=that.selectBox.departNames.join(',');
                    $.wyui.postMethod('/exam/getRoleNameListByCompanyAndDepart.json', {
                        companyIds: companyIds,
                        departNames: departNames
                    }, function (data) {
                        console.log(data);
                        for (var i = 0; i < data.result.length; i++) {
                            if (that.selectBox.roleNames.indexOf(data.result[i].roleName) != -1) {
                                data.result[i].select = true;
                            } else {
                                data.result[i].select = false
                            }
                        }

                        that.selectBox.roleList = data.result
                    })
                }
            },
            getUserIds:function () {
                var that=this;
                $.wyui.postMethod('/exam/getUserList.json', {
                    companyIds:that.selectBox.companyIds.join(','),
                    departNames:that.selectBox.departNames.join(','),
                    pageSize: 500,
                    requestPage: 1,
                    roleNames: that.selectBox.roleNames.join(',')

                }, function (data) {
                    var list=data.records;
                    var userIds=[];
                    if(list.length>0){
                        for(var i=0;i<list.length;i++){
                            userIds.push(list[i].userId)
                        }
                    }
                    that.selectBox.userIds=userIds;
                    console.log(that.selectBox.userIds);
                })
            },
            selectItem: function (item,type) {
                var check;
                if (type == '1') {
                    check = "companyIds"
                    this.checkedOne(check, item.id);
                } else if (type == '2') {
                    check = "departNames"
                    this.checkedOne(check, item.departName);
                } else {
                    check = "roleNames"
                    this.checkedOne(check, item.roleName);
                }
                if (item.select == true) {
                    item.select = false
                } else {
                    item.select =true
                }
                console.log(item)
            },
            checkedOne: function (checkList, moduleKey) {
                var that=this;
                var idIndex = this.selectBox[checkList].indexOf(moduleKey)
                if (idIndex >= 0) {
                    this.selectBox[checkList].splice(idIndex, 1)
                } else {
                    this.selectBox[checkList].push(moduleKey)
                }
                if(checkList=='companyIds'){
                    that.selectBox.departNames=[];
                    that.selectDepart()

                }
                if(checkList=='departNames'){
                    that.selectBox.roleNames=[];
                    that.selectRoleName()
                }
                if(checkList=='roleNames'){
                    if(that.selectBox.roleNames.length>0) {
                        that.getUserIds();
                    }else{
                        that.selectBox.userIds=[];
                    }
                }

            },
            fjStyle: function (fjName) {
                if (fjName) {
                    var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                    return 'img fj-' + type
                }
                return 'img'
            },
            hideLoading: function () {
                JSBridge.call(UI, 'hideLoading')
            },
            cancel:function (){
                this.userModel=false;
            },
            updateUser:function () {
                var that=this;
                JSBridge.call(UI, 'showLoading', {})
                setTimeout(function () {
                    that.hideLoading()
                }, 2000)
                this.userModel=true;
                this.treeObj.getNodesByFilter(function (node) {
                    if(that.mainInfo.voteUsers.indexOf(node.id)>-1) {
                        console.log(node.id)
                        that.treeObj.checkNode(node, true, true, false);
                    }else{
                        that.treeObj.checkNode(node, false, false, false);
                    }
                });

            },
            saveUser:function () {
                var _this=this;
                var receivers = new Array();
                var newPeople=new Array();
                var Nodes=[];
                if(this.selectTree=='1'){
                    if(this.selectBox.userIds.length>0){
                        Nodes=this.selectBox.userIds;
                    }else{
                        Nodes=[];
                    }
                }else{
                    searchTree(true);
                    Nodes = this.treeObj.getCheckedNodes(true);
                }
                if(Nodes.length>0){
                    for (var i = 0; i < Nodes.length; i++) {
                        if(Nodes[i].type == "user") {
                            receivers.push(Nodes[i].id);
                            if(_this.mainInfo.voteUsers.indexOf(Nodes[i].id)<0){
                                newPeople.push(Nodes[i].id);
                            }
                        }
                    }
                }

                if(receivers.length>0){
                    this.mainInfo.voteUsers=receivers.join(',')
                }else{
                    JSBridge.call(UI, 'showToast', {title: "投票人不能为空"})
                }
                if(newPeople.length>0){
                    this.mainInfo.newPeople=newPeople.join(',')
                }else{
                    this.mainInfo.newPeople='';
                }
                if(this.isGo) {
                    this.isGo = false;
                    delete _this.mainInfo.createTime
                    $.wyui.postMethod("/vote/saveVote.json", _this.mainInfo, function (r) {
                        _this.isGo = true;
                        JSBridge.call(UI, 'hideLoading')
                        if (r.id) {
                            JSBridge.call(UI, 'showToast', {title: "投票人员修改完成"})
                        } else {
                            JSBridge.call(UI, 'showToast', {title: "系统内容异常，请联系IT人员"})
                        }
                        _this.userModel=false;
                        _this.getTab(_this.selectIndex);
                    });
                }
            },
            showToast: function (title) {
                var param = {
                    title: title
                }
                JSBridge.call(UI, 'showToast', param)
            },
            compareDate:function(d2) {
                return ((new Date()) > (new Date(d2.replace(/-/g, "\/"))));
            },
            lookFj:function (url) {
                console.log("1");
                var that = this
                var param = {
                    url: url,
                }
                JSBridge.call(FILE, 'showFile', param)
            },
            initPage:function () {
                console.log("11")
                $('html,body').animate({scrollTop: '0px'}, 100);
            },
            getList:function (item,index,type,isOne) {
                var that=this;
                if(item){
                    that.parentId=item.parentId;
                    that.themeId=item.id
                    that.themeName=item.description;
                }
                $('.w').css('transform', 'translate3d(0px, 0px, 0px)')
                //如果有type则是切换tab调用 isOne是页面第一次进入
                if(type||isOne){
                    that.showInnerFile();
                }
                //如果有type则是切换tab调用
                if(type){
                    setTimeout(function () {
                        that.swiper.slideTo(index, 100, function () {
                        })
//                    that.mySwiper.update();
                        document.documentElement.scrollTop = 0
                    },200)
                }
                $.wyui.postMethod("/vote/getByThemeId.json", {"mainId":that.mainId,"parentId":that.parentId,"themeId":that.themeId}, function (res) {
                   that.list=res.result;
                    setTimeout(function () {
                        that.mySwiper.update(); // 重新计算高度;
                    },1000)

                });
            },
            closeModel:function () {
                console.log("1")
                this.showModel=false;
            },
            getTab:function(index,item,type,name,isOne){
                var that=this;

                that.selectIndex=index;
                if(item){
                    that.parentId=item.parentId;
                    that.themeId=item.id
                    that.themeName=item.description;
                }
                var type=type;
                if(!type){
                    type=false;
                }
                var isOne=isOne;
                if(!isOne){
                    isOne=false;
                }
                if($.cookie('themeName')){
                    if($.cookie('mainId')==that.mainId){
                        that.tou=$.cookie('themeName')
                    }
                }
                $.wyui.postMethod("/vote/getThemeList.json", {"mainId":that.mainId,"tel":that.userInfo.tel,"userId":that.userInfo.id}, function (res) {
                    console.log(res.main.title);
                    that.isEnd=that.compareDate(res.main.endTime);
                    var result=res.result;

                    var $body = $('body');
                    document.title = res.main.title;

                    var $iframe = $('<iframe src="/dist/img/icon.png"></iframe>');
                    $iframe.on('load',function() {
                        setTimeout(function() {
                            $iframe.off('load').remove();
                        }, 0);
                    }).appendTo($body);

                    that.status=res.status;
                    that.mainInfo=res.main;
                    if(result&&result.length>0){
                        var newList=result[0].optionList;
                        for(var i=0;i<newList.length;i++){
                            if(newList[i].attrUrl){
                                newList[i].attrUrlList=newList[i].attrUrl.split(';');
                                newList[i].attrNameList=newList[i].attrName.split(';');
                            }else{
                                newList[i].attrUrlList=[];
                                newList[i].attrNameList=[];
                            }
                        }
                        that.tabList=newList;
                        setIFrameH();
                        if(that.draftList.length==0){
                            for(var i=0;i<that.tabList.length;i++){
                                that.draftList.push("");
                            }
                        }
                        if(name){
                            for(var i=0;i<that.tabList.length;i++){
                                if(that.tabList[i].description==name){
                                    that.selectIndex=i;
                                }
                            }
                        }
                        that.enableNavigateBack();
                        that.getList(result[0].optionList[that.selectIndex],index,type,isOne)

                    }
                });
            },
            formatDate: function (now) {
              return  new Date(now).Format(TimeFormat.middle);

            },
            tp:function (type) {
                if(type=='2'){
                    this.isGood=2;
                }else{
                    this.isGood=1;
                }
                //H5 this.showModel=true;
                //原生
                var that = this
                var draftData=that.draftList[that.selectIndex];
                var param = {
                    data: '1',
                    content:draftData,
                    title: that.isGood==1?'请输入投票理由':'请输入不投票理由',
                    hint: that.isGood==1?'请输入投票理由':'请输入不投票理由',
                    tipMsg: that.isGood==1?'请输入投票理由':'请输入不投票理由',
                    confirmText: "确认",
                    cancelable: true
                }
                that.inputResult = "等待输入..."
                JSBridge.call(UI, 'showInputDialog', param, function (res) {
                    var craft=res.sendData.craft //草稿内容
                    var res=res.sendData.content //内容
                    if(!craft&&!res){
                        return false;
                    }
                    if(craft){
                        that.draftList[that.selectIndex]=craft;
                        return false;
                    }
                    if(!res||res=='无'||$.trim(res)==''){
                        JSBridge.call(UI, 'showToast', {title: "请简述理由"})
                        return false;
                    }
                    if(that.isGo){
                        that.isGo=false;
                        $.wyui.postMethod("/vote/saveResult.json", {"mainId":that.mainId,"parentId":that.parentId,"themeId":that.themeId,"reason":res,"createUserName":that.userInfo.name,"createUserId":that.userInfo.id,"tel":that.userInfo.tel,"status":that.isGood}, function (res) {
                            console.log(res)
                            that.draftList[that.selectIndex]='';
                            that.reason="";
                            that.isGo=true
                            that.showModel=false;
                            JSBridge.call(UI, 'showToast', {title: "投票成功，感谢您的参与"})
                            var param = {
                                isShow: false
                            }
                            JSBridge.call(UI, 'showInnerFile', param, function (res) {

                            })
                            that.getTab(that.selectIndex);
                        });
                    }

                })
            },

            save:function () {
                var that=this;
                if(!that.reason||that.reason=='无'||$.trim(that.reason)==''){
                    JSBridge.call(UI, 'showToast', {title: "请简述理由"})
                    return false;
                }
                if(this.isGo){
                    this.isGo=false;
                    $.wyui.postMethod("/vote/saveResult.json", {"mainId":that.mainId,"parentId":that.parentId,"themeId":that.themeId,"reason":that.reason,"createUserName":that.userInfo.name,"createUserId":that.userInfo.id,"tel":that.userInfo.tel,"status":that.isGood}, function (res) {
                        console.log(res)
                        that.reason="";
                        that.isGo=true
                        that.showModel=false;
                        JSBridge.call(UI, 'showToast', {title: "投票成功，感谢您的参与"})
                        that.getTab(that.selectIndex);
                    });
                }

            },
            enableNavigateBack: function () {
                var isEnable=true;
                var that=this;
                if(that.mainInfo.auditFlag!='-1'||that.status=='3'){
                    isEnable=true;
                }else{
                    var names=[];
                    for(var i=0;i<that.tabList.length;i++){
                        var data=that.tabList[i];
                        if(data.flag==3){
                            names.push(data.description)
                        }
                    }
                    if(names.length>0){
                        isEnable=false;
                        that.enableMsg="您尚未对"+names.join(",")+"填写投票或不投票理由 请前往填写"
                    }else{
                        that.enableMsg=''
                        isEnable=true;
                    }
                }
                var param = {
                    enableNavigateBack: isEnable,
                }
                JSBridge.call(UI, 'setEnableNavigateBack', param)
            }
        },
        mounted: function () {
            var that=this;
            var loadFlag = true;
            var oi = 0;
            that.getCompanyList();
            JSBridge.call(UI, 'hideLoading')
            that.mySwiper = new Swiper('#scroll',{
                direction: 'vertical',
                scrollbar: '.swiper-scrollbar',
                slidesPerView: 'auto',
                mousewheelControl: true,
                freeMode: true,
                onTouchMove: function(swiper){		//手动滑动中触发
                    var _viewHeight = document.getElementsByClassName('swiper-wrapper')[0].offsetHeight;
                    var _contentHeight = document.getElementsByClassName('swiper-slide')[0].offsetHeight;


                    if(that.mySwiper.translate < 50 && that.mySwiper.translate > 0) {
                        $(".init-loading").html('下拉刷新...').show();
                    }else if(that.mySwiper.translate > 50 ){
                        $(".init-loading").html('释放刷新...').show();
                    }
                },
                onTouchEnd: function(swiper) {
                    var _viewHeight = document.getElementsByClassName('swiper-wrapper')[0].offsetHeight;
                    var _contentHeight = document.getElementsByClassName('swiper-slide')[0].offsetHeight;
                    // 上拉加载
                    if(that.mySwiper.translate <= _viewHeight - _contentHeight - 50 && that.mySwiper.translate < 0) {
                        // console.log("已经到达底部！");

                        if(loadFlag){
                            $(".loadtip").html('正在加载...');
                        }else{
                            $(".loadtip").html('没有更多啦！');
                        }

                        setTimeout(function() {
                            $(".loadtip").html('上拉加载更多...');
//                            that.mySwiper.update(); // 重新计算高度;
                        }, 800);
                    }

                    // 下拉刷新
                    if(that.mySwiper.translate >= 50) {
                        $(".init-loading").html('正在刷新...').show();
                        that.getTab(that.selectIndex);
                        loadFlag = true;
                        setTimeout(function() {
                            $(".refreshtip").show(0);
                            $(".init-loading").html('刷新成功！');
                            setTimeout(function(){
                                $(".init-loading").html('').hide();
                            },800);

                            //刷新操作
//                            that.mySwiper.update(); // 重新计算高度;
                        }, 1000);
                    }else if(that.mySwiper.translate >= 0 && that.mySwiper.translate < 50){
                        $(".init-loading").html('').hide();
                    }
                    return false;
                }
            });

            $.wyui.postMethod("/vote/getUserInfoByUserId.json", {id:that.userId}, function (info) {
                that.userInfo=info.userInfo
                if(that.name){
                    that.getTab(0,'','',that.name,true);
                }else{
                    that.getTab(0,'','','',true);
                }

            });


            that.timer = setInterval(function () {
                that.getTab(that.selectIndex);
            }, 30000)
            //页面初次加载  执行客户分页列表
        }
    });
    Vue.directive('intab', {
        inserted: function (el, binding) {
            var num=app.tabList.length
            if(app.tabList.length>4){
                num=4.5
            }
            var tSpeed = 300 //切换速度300ms
            app.swiper = new Swiper('#nav',{
                slidesPerView:num,
                freeMode: true,
                on:{
                    init: function() {
                        navSlideWidth = this.slides.eq(0).css('width'); //导航字数需要统一,每个导航宽度一致
                        navSum = this.slides[this.slides.length - 1].offsetLeft //最后一个slide的位置
                        clientWidth = parseInt(this.$wrapperEl.css('width')) //Nav的可视宽度
                        navWidth = 0
                        for (i = 0; i < this.slides.length; i++) {
                            navWidth += parseInt(this.slides.eq(i).css('width'))
                        }
                    }
                },
            });


        }
    })


</script>
<script>

    $(".search-button").on('click', function () {
        searchTree()
    });
    function searchTree(type) {
        var text=''
        if(type){
            text = '';
        }else{
            text = $(".selecetInput").val();

        }

        if (text != "") {
            var allNode = app.treeObj.transformToArray(app.treeObj.getNodes());
            ;
            app.treeObj.hideNodes(allNode);
            nodeList = app.treeObj.getNodesByParamFuzzy("name", text);
            nodeList = app.treeObj.transformToArray(nodeList);
            for (var n in nodeList) {
                app.treeObj.selectNode(nodeList[n], true);
                findParent(app.treeObj, nodeList[n]);
            }
            app.treeObj.showNodes(nodeList);

        } else {
            var allNode = app.treeObj.transformToArray(app.treeObj.getNodes());
            ;
            app.treeObj.showNodes(allNode);
            app.treeObj.cancelSelectedNode();
            app.treeObj.expandAll(false);
            for (var index in allNode) {
                if (allNode[index].level < 2) {
                    app.treeObj.expandNode(allNode[index], true, false, false);
                }
            }

        }
    }

    function findParent(treeObj, node) {
        treeObj.expandNode(node, true, false, false);
        var pNode = node.getParentNode();
        if (pNode != null) {
            nodeList.push(pNode);
            findParent(treeObj, pNode);
        }
    }


</script>
<script>

    //调整高度

    function setIFrameH() {
        setTimeout(function () {  //使用  setTimeout（）方法设定定时2000毫秒
            var H = $(window).height()
            console.log(app.tabList[app.selectIndex].attrUrlList.length);
            var num=app.tabList[app.selectIndex].attrUrlList.length;
            if(num>=1){num=num-1;}
            $(".scrollHeight").height(H - 140-num*45);
            $(".scrollHeight").css("padding-top",45+45*num+'px');
        }, 200);
    }
</script>
<script>
    //禁用返回键后,点击app返回键回调
    function onBackPressed(enableNavigateBack) {
        if(!enableNavigateBack){
            app.showToast(app.enableMsg)
        }else{
            if(app.scfj){
                var param = {
                    backRefresh: true,       //是否返回刷新
                }
                JSBridge.call(ROUTER, 'navigateBack', param)
            }
        }
    }
</script>
<script src="https://cdn.bootcss.com/html5media/1.1.8/html5media.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    var url = location.href.split('#').toString();
    var title = "滚滚向前投票助手";
    var discuss = "滚滚向前投票助手";
    var shareImgUrl = 'http://oa.yingfeng365.com/dist/img/tplgo.png';
    var timestamp;
    var noncestr;
    var signature;
    //获取签名
    $.ajax({
        type: "GET",
        url: server.ip+"/wshare/getSignature.json",
        //data:{timestamp:timestamp,noncestr:noncestr,url:url},
        data: {url: url},
            success: function (data) {
                console.log("success");
                var objData = data;
            timestamp = objData.timestamp;
            noncestr = objData.noncestr;
            signature = objData.signature;
            console.log(objData);
            wxShare();
        },
            statusCode: {
                404: function () {
                    alert('page not found');
                }
        }
    });
    function wxShare() {
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: 'wx687174fc0632009d', // 和获取Ticke的必须一样------必填，公众号的唯一标识
            timestamp: timestamp, // 必填，生成签名的时间戳
            nonceStr: noncestr, // 必填，生成签名的随机串
            signature: signature,// 必填，签名，见附录1
            jsApiList: [
                'onMenuShareAppMessage', 'onMenuShareTimeline'
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
    }
    wx.ready(function () {
        //config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，
        //config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关
        //接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
        var title = $("title").html();
        //----------“分享给朋友”
        wx.onMenuShareAppMessage({
            title: title, // 分享标题
            desc: discuss, // 分享描述
            link: url, // 分享链接
            imgUrl: shareImgUrl, // 分享图标
            success: function () {
                console.log("1")
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });
        //------------"分享到朋友圈"
        wx.onMenuShareTimeline({
            title: title, // 分享标题
            desc: discuss, // 分享描述
            link: url, // 分享链接
            imgUrl: shareImgUrl, // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {


                // 用户确认分享后执行的回调函数、
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });


    });
    wx.error(function (res) {
        // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
        console.log(res);
    });
</script>
</body>